package com.zone.api.database

import android.content.Context
import android.content.SharedPreferences
import com.zone.api.BuildConfig
import com.zone.core.CoreApplication
import com.zone.skybase.constant.KEY_SERVER_URL

class AppConfig() {
    private val sharedPreferences: SharedPreferences =
        CoreApplication.coreApp.getSharedPreferences("AppConfig", Context.MODE_PRIVATE)

    var serverUrl: String
        get() = sharedPreferences.getString(KEY_SERVER_URL, BuildConfig.SERVER_URL)
            ?: BuildConfig.SERVER_URL
        set(value) {
            sharedPreferences.edit().putString(KEY_SERVER_URL, value).apply()
        }

}
